feat(examples): link Domains by DomainId to preserve ENSv1/ENSv2 variant#2180
Conversation
Split the enskit example's Domain browser into /domain/name/:name and /domain/id/:id, both backed by a single domain(by: DomainIdInput!) query. Search, Account, and subdomain/parent links now navigate by DomainId so clicking the v1 variant of a name lands on the v1 Domain rather than its v2 canonical. Closes #2141 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThis PR implements version-locked integration documentation and schema-driven docs, derives SDK install pins from ACTIVE_OMNIGRAPH_VERSION, adds v1.13.1 and v1.14.1 walkthroughs (enskit, enssdk, Omnigraph API, quickstart), updates the schema doc explorer to load versioned snapshots, and refactors example apps to use canonical domain fields and ID-based routing. ChangesDocumentation & schema infrastructure
Versioned Integration Walkthroughs
Example Applications & playground
Estimated code review effort 🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR fixes a bug where clicking an ENSv1 domain in the example app would silently redirect to the ENSv2 canonical, by switching from name-based (Namegraph) routing to DomainId-based routing wherever a stable ID is already in hand. The scope expanded to migrate all examples to
Confidence Score: 5/5Safe to merge — the domain routing fix is isolated to the example app, schema migration is consistent across all three examples, and the docs version-locking pattern builds deterministically with a compile-time throw for unmapped versions. Changes are well-scoped: the routing split is contained to the enskit example, resolveMonorepoSpecifier correctly handles workspace:* for the playground, and the docs switch pattern throws at build time rather than silently rendering stale content. No data-loss paths, no auth surface, no production API calls changed. No files require special attention. The version-locked walkthrough partials under @components/walkthroughs/ will need a new partial and a case entry each time ACTIVE_OMNIGRAPH_VERSION is promoted — the throw-on-default guards that gate. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User clicks a link] --> B{Link type?}
B -->|by name| C["DomainByNameView /domain/name/:name"]
B -->|by DomainId| D["DomainByIdView /domain/id/:id"]
C --> E[EnsureInterpretedName]
E -->|coerced| G["Redirect to normalized name"]
E -->|malformed| H["Error page"]
E -->|valid| I["RenderDomain by = name"]
D --> K["RenderDomain by = id"]
I --> L["DomainQuery by: DomainIdInput"]
K --> L
L --> M{API response}
M -->|not found| N["No domain found message"]
M -->|found| O["Render Domain details"]
O --> P["Parent link via DomainId"]
O --> Q["Subdomain links via DomainId"]
R["Search / Account views"] -->|navigate by DomainId| D
Reviews (14): Last reviewed commit: "fix: clean up stackblitz env handling" | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
This PR updates the enskit-react-example app to link and navigate to Domains by DomainId (stable identifier) rather than by name (namegraph addressing), so users land on the exact ENSv1/ENSv2 Domain variant they clicked (e.g., ENSv1 vitalik.eth no longer routes to the ENSv2 canonical).
Changes:
- Update Search and Account results, plus parent/subdomain links, to navigate via
/domain/id/:id. - Split Domain browsing into two routes:
/domain/name/:name(canonical resolution) and/domain/id/:id(exact Domain). - Consolidate the Domain view query to a single
domain(by: DomainIdInput!)query shared by both routes, and add explanatory commentary + a Changeset.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/enskit-react-example/src/SearchView.tsx | Switch result links to /domain/id/:id to preserve selected ENSv1/ENSv2 variant. |
| examples/enskit-react-example/src/DomainView.tsx | Add unified DomainByQuery, introduce DomainByNameView vs DomainByIdView, and update subdomain/parent navigation to stable IDs. |
| examples/enskit-react-example/src/App.tsx | Update navigation and routing to new /domain/name/:name and /domain/id/:id paths. |
| examples/enskit-react-example/src/AccountView.tsx | Switch owned-domain links to /domain/id/:id for stable navigation. |
| .changeset/enskit-example-domain-by-id.md | Record the example-app routing/linking behavior change as a patch Changeset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… schema
The example apps pinned published preview enssdk/enskit, masking them from
workspace schema changes. Switch all examples to workspace:* and migrate
their queries from the removed Domain.name field to the materialized
canonical { name { beautified } }. Point hosted-instance usage at the `blue`
v2-sepolia deployment (ENSNode 1.14.x), which serves the matching schema.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ive version The schema reference rendered the live `main` SDL while examples were locked to the production-deployed version; the walkthroughs hardcoded 1.14.x schema/code against production endpoints running 1.13.1 — so both were broken against production. - Schema reference (OmnigraphSchemaDocExplorer) now loads the active version's frozen schema.graphql instead of `enssdk/omnigraph/schema.graphql?raw`. - Walkthroughs (omnigraph-graphql-api, enssdk, enskit) are split into per-version MDX partials under @components/walkthroughs/<guide>/, with the route page rendering the partial matching ACTIVE_OMNIGRAPH_VERSION. Authored v1.13.1 (production) and v1.14.1 (blue) variants; promote by bumping the constant. - HostedInstanceSdkVersionWarning derives the pinned SDK version from the active version. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- SearchView: correct copy to `where: { name: { starts_with } }` matching the
actual filter; compute visibleEdges so an all-non-canonical page shows "No matches."
- DomainView: drop unreachable param guards (route guarantees the segment)
- playground loader: update ENSNODE_URL envReplacements regex for the new
`?? "<default>"` form so the enssdk-example test passes again
- enssdk-example README: fix mismatched code fence
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@greptile review |
- playground: point injected ENSNODE_URL at the `blue` (1.14.x) deployment so the enssdk/enskit interactive playgrounds match the 1.14.x schema their example source now targets; the non-`blue` v2-sepolia instance serves the old schema and would fail at runtime - DomainView: drop stale "since we catch the empty string case above" comment (that guard was removed in loop 1) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@greptile review |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@examples/enskit-react-example/src/DomainView.tsx`:
- Around line 56-57: The Link URL construction in DomainView.tsx uses raw domain
IDs (e.g., domain.id and data.domain.parent.id) which may contain slashes from
ENSv1 IDs and break the single-segment route; update the Link to build the path
using a URL-safe encoding (e.g., wrap the ID with encodeURIComponent) whenever
interpolating into `/domain/id/:id` so the entire ENSv1DomainId remains a single
path segment for the Link and any router navigation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 713c56f8-dc82-4ff3-abef-711468d42237
📒 Files selected for processing (22)
docs/ensnode.io/src/components/molecules/HostedInstanceSdkVersionWarning.astrodocs/ensnode.io/src/components/molecules/IntegrateHostedEnsNodeTip.astrodocs/ensnode.io/src/components/organisms/OmnigraphSchemaDocExplorer.tsxdocs/ensnode.io/src/components/walkthroughs/enskit/v1.13.1.mdxdocs/ensnode.io/src/components/walkthroughs/enskit/v1.14.1.mdxdocs/ensnode.io/src/components/walkthroughs/enssdk/v1.13.1.mdxdocs/ensnode.io/src/components/walkthroughs/enssdk/v1.14.1.mdxdocs/ensnode.io/src/components/walkthroughs/quickstart/v1.13.1.mdxdocs/ensnode.io/src/components/walkthroughs/quickstart/v1.14.1.mdxdocs/ensnode.io/src/content/docs/docs/hosted-instances.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/enskit/example.mdxdocs/ensnode.io/src/content/docs/docs/integrate/integration-options/enssdk/example.mdxdocs/ensnode.io/src/content/docs/docs/integrate/unigraph/schema-reference.mdxdocs/ensnode.io/src/lib/playground/constants.tsdocs/ensnode.io/src/lib/playground/loadEnssdkExampleProject.tsexamples/enskit-react-example/README.mdexamples/enskit-react-example/src/DomainView.tsxexamples/enskit-react-example/src/SearchView.tsxexamples/enssdk-example/README.mdexamples/enssdk-example/src/index.tsexamples/omnigraph-graphql-example/README.mdexamples/omnigraph-graphql-example/src/index.ts
Closes #2141.
When a name like
vitalik.ethhas both an ENSv1 and an ENSv2 Domain, clicking the v1 variant in the enskit example app would land on the v2 canonical, because links navigated by name (Namegraph addressing, which resolves to the Canonical Domain).This switches links to navigate by DomainId (a stable reference) wherever one is already in hand, so users land on the exact Domain they clicked. See the Stable IDs vs. Namegraph addressing docs.
Scope grew while in here: the example apps were un-pinned to
workspace:*(and migrated to the currentmainOmnigraph schema), and the docs were version-locked to track production rather thanmain.domain-by-id (the original fix)
domain(by: DomainIdInput!)query (the@oneOfof{ id }/{ name }) shared by both views —RenderDomaintakes aby: { id } | { name }prop and passes whichever stable reference it has/domain/name/:name— resolves to a name's Canonical Domain (keeps theEnsureInterpretedNameflow)/domain/id/:id— addresses an exact Domain, preserving its ENSv1/ENSv2 variantDomainId/domainnow 404s rather than redirectingDomainBytype explaining the stable-id vs. namegraph distinction, linking the docsexamples on
workspace:*enssdk/enskit, which froze them against an old schema. switched all examples toworkspace:*so they trackmain.Domain.nameto the materializedcanonical { name { beautified } }.docs version-locking
Because the in-repo examples now use
workspace:*(i.e.main= the latest Omnigraph schema) but the public hosted instances still run the previous release, the docs would otherwise teach queries that don't run against production. So the docs are vendor-versioned the same way the Omnigraph examples already are — frozen per-version and selected byACTIVE_OMNIGRAPH_VERSION:versions/<version>/schema.graphqlinstead of the livemainSDL.omnigraph-graphql-api,enssdk,enskit, the ENSv2 Quickstart) are split into per-version MDX partials under@components/walkthroughs/<guide>/, and each route page renders the partial matchingACTIVE_OMNIGRAPH_VERSION. authoredv1.13.1(current production) andv1.14.1(thebluedeployment) variants; the selector throws on an unmapped version. promote by bumping the one constant.HostedInstanceSdkVersionWarningderives the pinned SDK version from the active version.This keeps the in-repo examples free to use
workspace:*/ the latest schema without breaking the published docs against production. (theomnigraph/indexconcepts page is left as-is — its 1.13.1 framing differs materially.) the Omnigraph examples snapshot/responses forv1.14.1are handled in a separate PR.verification
pnpm typecheck,pnpm lint, gql.tada codegen, and the docs build all pass; rendered pages confirm the active (v1.13.1) content. example apps have no tests; both script examples run against theblue1.14.x endpoint.🤖 Generated with Claude Code